<template>
  <div id="order">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane v-for="item in labels" :key="item" :label="item" :name="item">
        <ordertable ref="msg" />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import ordertable from './table.vue'

export default {
  components: {
    ordertable
  },
  data() {
    return {
      activeName: '所有订单',
      labels: ['所有订单', '待支付', '待派单', '待接单', '待服务', '待确定', '已完成']
    }
  },
  mounted() {
    this.$refs.msg[0].findAllorder(this.activeName)
  },
  methods: {
    handleClick(tab, event) {
      console.log(tab, event)
      // console.log(this.$refs.msg[tab.index],'---==');
      this.$refs.msg[tab.index].findAllorder(this.activeName)
    }
  }
}
</script>

<style lang="scss" scoped>
#order{
  padding:20px;
}
</style>
